# -*- coding: utf-8 -*-
"""
Module Description: var资源日志组件,用于活动埋点（银粮兵宝不在此类作特殊处理）
Date: 2020/03/20
Author: sxj
"""
from pyshare.const.enums.log import FieldName
from pyshare.utils.game_log.log_param import LogParam
from pyshare.utils.game_log.log_utils import LogManager
from common.service_config import get_action_id


class SilversTaxingLog(object):
    """
    征银记录日志
    """
    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.SilversTaxing
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)


class WorshipLeaderboardLog(object):
    """
    膜拜记录日志
    """
    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.WorshipLeaderboard
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)


class TravelLog(object):
    """
    寻访记录日志
    """

    to_point_times_remark = '使用寻访令一键寻访'

    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.Travel
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)


class AttackHuntBossLog(object):
    """
    攻击穷奇记录日志
    """
    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.AttackHuntBoss
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)


class AcceptDrillRequestLog(object):
    """
    校场准奏记录日志
    """
    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.AcceptDrillRequest
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)


class AllianceSeniorBuildLog(object):
    """
    联盟高级建设记录日志
    """
    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.AllianceSeniorBuild
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)


class RechargeAmountLog(object):
    """
    验证订单金额记录日志
    """
    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.RechargeAmount
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)


class JoinTeaCompeteLog(object):
    """
    加入茶话比拼记录日志
    """
    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.JoinTeaCompete
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)


class GetMonthPlanDayAwardLog(object):
    """
    领取月卡记录日志
    """
    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.GetMonthPlanDayAward
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)


class GetYearPlanDayAwardLog(object):
    """
    领取年卡记录日志
    """
    @staticmethod
    def log_game(rid, remark, reserve=None):
        """
        :param rid:
        :param remark: 资源日志分类
        :param filed_name: 备注
        :param reserve: 扩展字段
        :return:
        """
        log_param = LogParam(rid=rid)
        log_param.field_name = FieldName.GetYearPlanDayAward
        log_param.scene = get_action_id()
        log_param.remark = remark
        log_param.reserve = reserve
        LogManager.log_game(log_param)